! function(window, document, $, undefined) {
    let init = function() {
        render();
    }
    let render = function() {
        $.ajax({
            type: "get",
            url: "/category/queryTopCategory",
            dataType: "json",
            success: function(response) {
                let temp = template("listTemp", response.rows);
                $(".list>ul").html(temp)
            }
        });
    }

    $(".list").on("click", "li", function() {
        let id = $(this).attr("data-id");
        $(this).addClass("active").siblings().removeClass("active")
        console.log($(this).addClass("active").siblings())
        $.ajax({
            type: "get",
            url: " /category/querySecondCategory",
            data: { id },
            dataType: "json",
            success: function(response) {
                let temp = template("contentTemp", response);
                $(".content>ul").html(temp)
            }
        });
    })

    init()

}(window, document, Zepto)